package com.cskaoyan.config;

import com.cskaoyan.interceptor.AdminHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ description:
 * @ author:台
 **/
@Configuration
public class WebConfiguration implements WebMvcConfigurer {

    @Autowired
    AdminHandlerInterceptor adminHandlerInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(adminHandlerInterceptor).excludePathPatterns("/admin/auth/401").addPathPatterns("/admin/**");
    }
}
